package com.qmyx.supply.admin.controller;

import com.ytjj.qmyx.supplychain.common.api.CommonResult;
import com.ytjj.qmyx.supplychain.service.IndexService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 
 * 
 * @Version: 1.0
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @Resource
    private IndexService indexService;

    @PostMapping("/getData")
    public CommonResult getIndexData() {
        return CommonResult.success(indexService.getIndexData());
    }

    @GetMapping("/getRank")
    public CommonResult getIndexData(@RequestParam String dateType) {
        return CommonResult.success(indexService.getIndexRank(dateType));
    }

}
